#include <stdio.h>

double inner_product(const double *a, const double *b, int n){
	double prod = 0;
	for(int i = 0; i < n; ++i){
		prod = prod + (*(a+i) * *(b+i));
	}
	return prod;
}

int main(){
	const double x[] = {0, 3, 2.2};
	const double y[] = {2, 2, 1.2};
	double prod = inner_product(&x, &y, 3);
	printf("prod is : %f\n", prod);
}
